package com.treasure.mall.biz.dto.pay;

import com.treasure.mall.biz.dto.BaseSaveDTO;
import com.treasure.mall.biz.entity.order.OrderPO;
import com.treasure.mall.zbq.common.ienum.order.OrderEnums;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/6/14
 */
@Data
@NoArgsConstructor
public class PaymentBillSaveDTO implements BaseSaveDTO {
    private static final long serialVersionUID = 3926274943902781135L;

    private String orderId;
    private Long userId;
    private OrderEnums.PayType payType;
    private BigDecimal amount;
    private OrderEnums.DealType dealType;
    private String openId;
    private boolean thirdPay;
    private Long auctionSessionId;

    public PaymentBillSaveDTO(OrderEnums.DealType dealType, OrderPO orderPO) {
        this.dealType = dealType;
        this.orderId = orderPO.getOrderId();
        this.userId = orderPO.getUserPO().getUserId();
        this.openId = orderPO.getUserPO().getWechatUser().getOpenId();
    }
}
